package com.define.commons.query.service;

import com.define.commons.query.core.Query;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

/**
 * 根据泛型提供基础CRUD的 Service
 * 对 CommonMapper 提供的接口进行整理去掉冲突的接口
 * @Author xiewenlong
 * @Date 2018/10/31 12:49
 */
public interface CommonMapperBaseService<T> {
    PageInfo<T> getPage(Query query);

    PageInfo<T> getPage(Integer page, Integer pageSize);

    PageInfo<T> getPage(T t, Integer page, Integer pageSize);

    public int deleteByPrimaryKey(Object key);

    public int delete(T record);

    public int insert(T record);

    public int insertSelective(T record);

    public boolean existsWithPrimaryKey(Object key);

    public List<T> selectAll();

    public T selectByPrimaryKey(Object key);

    public int selectCount(T record);

    public List<T> select(T record);

    public T selectOne(T record);

    public int updateByPrimaryKey(T record);

    public int updateByPrimaryKeySelective(T record);

    public int deleteByExample(Object example);

    public List<T> selectByExample(Object example);

    public int selectCountByExample(Object example);

    public T selectOneByExample(Object example);

    public int updateByExample(T record, Object example);

    public int updateByExampleSelective(T record, Object example);

    public List<T> selectByExampleAndRowBounds(Object example, RowBounds rowBounds);

    public List<T> selectByRowBounds(T record, RowBounds rowBounds);

    public int insertList(List<? extends T> recordList);

    public int insertUseGeneratedKeys(T record);
}
